/** * @license * Copyright (c) 2014, 2018, Oracle and/or its affiliates. * The Universal Permissive License (UPL), Version 1.0 */ "use strict";define(["ojs/ojcore","jquery","ojs/ojcomponentcore","ojs/ojbutton","ojs/ojmenu","ojs/ojlistview"],function(t,e){var i={properties:{currentItem:{type:"any",writeback:!0},data:{type:"oj.TableDataSource|oj.TreeDataSource|oj.DataProvider"},display:{type:"string",enumValues:["all","icons"],value:"all"},drillMode:{type:"string",enumValues:["collapsible","none","sliding"],value:"none"},edge:{type:"string",enumValues:["start","top"],value:"start"},expanded:{type:"KeySet",writeback:!0,value:"new ExpandedKeySet();"},hierarchyMenuThreshold:{type:"number",value:0},item:{type:"object",properties:{renderer:{type:"function",properties:{componentElement:{type:"Element"},datasource:{type:"oj.DataProvider"},index:{type:"number"},key:{type:"any"},data:{type:"any"},parentElement:{type:"Element"}}},selectable:{type:"function|boolean",value:!0,properties:{componentElement:{type:"Element"},datasource:{type:"oj.DataProvider"},index:{type:"number"},key:{type:"any"},data:{type:"any"},parentElement:{type:"Element"}}}}},overflow:{type:"string",enumValues:["hidden","popup"],value:"hidden"},rootLabel:{type:"string",value:"Navigation List"},selection:{type:"any",writeback:!0},translations:{type:"object",value:{},properties:{defaultRootLabel:{type:"string"},hierMenuBtnLabel:{type:"string"},previousIcon:{type:"string"}}}},methods:{getContextByNode:{},refresh:{},setProperty:{},getProperty:{},setProperties:{},getNodeBySubId:{},getSubIdByNode:{}},events:{ojAnimateStart:{},ojAnimateEnd:{},ojBeforeSelect:{},ojBeforeCollapse:{},ojBeforeCurrentItem:{},ojCollapse:{},ojBeforeExpand:{},ojExpand:{}},extension:{}},n={properties:{currentItem:{type:"any",writeback:!0},data:{type:"oj.TableDataSource|oj.DataProvider"},display:{type:"string",enumValues:["all","icons"],value:"all"},edge:{type:"string",enumValues:["bottom","end","start","top"],value:"start"},item:{type:"object",properties:{renderer:{type:"function",properties:{componentElement:{type:"Element"},datasource:{type:"oj.DataProvider"},index:{type:"number"},key:{type:"K"},data:{type:"D"},parentElement:{type:"Element"}}},selectable:{type:"function|boolean",value:!0,properties:{componentElement:{type:"Element"},datasource:{type:"oj.DataProvider"},index:{type:"number"},key:{type:"K"},data:{type:"D"},parentElement:{type:"Element"}}}}},overflow:{type:"string",enumValues:["hidden","popup"],value:"hidden"},reorderable:{type:"string",enumValues:["disabled","enabled"],value:"disabled"},selection:{type:"any",writeback:!0},translations:{type:"object",value:{},properties:{accessibleReorderAfterItem:{type:"string"},accessibleReorderBeforeItem:{type:"string"},accessibleReorderTouchInstructionText:{type:"string"},labelCut:{type:"string"},labelPasteAfter:{type:"string"},labelPasteBefore:{type:"string"},labelRemove:{type:"string"},msgFetchingData:{type:"string"},msgNoData:{type:"string"},overflowItemLabel:{type:"string"},removeCueText:{type:"string"},selectedLabel:{type:"string"}}},truncation:{type:"string",enumValues:["none","progressive"],value:"none"}},methods:{getContextByNode:{},refresh:{},setProperty:{},getProperty:{},setProperties:{},getNodeBySubId:{},getSubIdByNode:{}},events:{ojAnimateStart:{},ojAnimateEnd:{},ojBeforeSelect:{},ojBeforeCurrentItem:{},ojBeforeDeselect:{},ojDeselect:{},ojBeforeRemove:{},ojRemove:{},ojReorder:{}},extension:{}};t.DefaultNavListHandler=function(t,e,i){this.m_widget=t,this.m_root=e,this.m_component=i,this.m_widget.GetOption(this.m_widget.OPTION_EDGE)===this.m_widget.OPTION_EDGE_END&&this.m_root.addClass(this.m_widget.getNavListEndEdgeStyleClass())},t.DefaultNavListHandler.prototype.Destroy=function(){this.m_root.removeClass(this.m_widget.getNavListExpandedStyleClass()).removeClass(this.m_widget.getNavListVerticalStyleClass()).removeClass(this.m_widget.getNavListEndEdgeStyleClass())},t.DefaultNavListHandler.prototype.Expand=function(t,e,i){return Promise.resolve(null)},t.DefaultNavListHandler.prototype.Collapse=function(t,e,i,n){return Promise.resolve(null)},t.DefaultNavListHandler.prototype.HandleExpandAndCollapseKeys=function(t,e,i,n){return!1},t.DefaultNavListHandler.prototype.ModifyListItem=function(t,e){this.m_widget.isTabBar()&&this.m_widget.getSingleFocusableElement(t).attr("role","tab")},t.DefaultNavListHandler.prototype.UpdateAriaPropertiesOnSelectedItem=function(t,e){t.attr("aria-selected",e?"true":"false")},t.DefaultNavListHandler.prototype.BeforeRenderComplete=function(){var t=this.m_widget.element.attr("role");t&&"presentation"!=t&&(this.m_widget.element.attr("role","presentation"),this.m_widget.isTabBar()?this.m_root.attr("role","tablist"):this.m_root.attr("role",t))},t.DefaultNavListHandler.prototype.ItemInsertComplete=function(t,e){},t.DefaultNavListHandler.prototype.ItemRemoveComplete=function(t){},t.DefaultNavListHandler.prototype.HandleArrowKeys=function(t,e,i){return s.superclass.HandleArrowKeys.apply(this.m_widget,arguments)},t.DefaultNavListHandler.prototype.IsArrowKey=function(t){return s.superclass.IsArrowKey.apply(this.m_widget,arguments)},t.DefaultNavListHandler.prototype.GetState=function(t){return s.superclass.GetState.apply(this.m_widget,arguments)},t.DefaultNavListHandler.prototype.SetState=function(t,e){s.superclass.SetState.apply(this.m_widget,arguments)},t.DefaultNavListHandler.prototype.Init=function(t){this.m_root.addClass(this.m_widget.getNavListExpandedStyleClass()).addClass(this.m_widget.getNavListVerticalStyleClass())},t.DefaultNavListHandler.prototype.IsSelectable=function(t){return s.superclass.IsSelectable.apply(this.m_widget,arguments)},t.DefaultNavListHandler.prototype.RestoreItem=function(t,e,i){},t.DefaultNavListHandler.prototype.SetOptions=function(t){},t.DefaultNavListHandler.prototype.HandleBlur=function(t){return s.superclass.HandleBlur.apply(this.m_widget,arguments)},t.DefaultNavListHandler.prototype.HandleFocus=function(t){return s.superclass.HandleFocus.apply(this.m_widget,arguments)},t.DefaultNavListHandler.prototype.GetNodeBySubId=function(t){return null},t.DefaultNavListHandler.prototype.GetSubIdByNode=function(t){return null},t.DefaultNavListHandler.prototype.HandleResize=function(t,e){},t.DefaultNavListHandler.prototype.NotifyAttached=function(){},t.DefaultNavListHandler.prototype.GetAnimationEffect=function(t){return s.superclass.getAnimationEffect.apply(this.m_widget,arguments)},t.DefaultNavListHandler.prototype.IsOptionUpdateAllowed=function(t,e,i){return!0},t.DefaultNavListHandler.prototype.OptionUpdated=function(t,e,i){},t.DefaultNavListHandler.prototype.BeforeInsertItem=function(){},t.DefaultNavListHandler.prototype.HandleClick=function(t){},t.DefaultNavListHandler.prototype.HandleKeydown=function(t){},t.HorizontalNavListHandler=function(e,i,n){this.m_duringInit=!0,t.HorizontalNavListHandler.superclass.constructor.call(this,e,i,n),this.m_widget.GetOption(this.m_widget.OPTION_EDGE)===this.m_widget.OPTION_EDGE_BOTTOM&&this.m_root.addClass(this.m_widget.getNavListBottomEdgeStyleClass())},t.Object.createSubclass(t.HorizontalNavListHandler,t.DefaultNavListHandler,"oj.HorizontalNavListHandler"),t.HorizontalNavListHandler.prototype.Destroy=function(){this.m_root.removeClass(this.m_widget.getNavListExpandedStyleClass()).removeClass(this.m_widget.getHorizontalNavListStyleClass()).removeClass(this.m_widget.getNavListBottomEdgeStyleClass()),this.m_root.find("."+this.m_widget.getDividerStyleClass()).remove(),this._destroyOverflowMenu(),null!=this.m_overflowMenuItem&&(this.m_overflowMenuItem.remove(),this.m_overflowMenuItem=null),this.m_overflowMenuItems=[],this.m_duringInit=!0},t.HorizontalNavListHandler.prototype.UpdateAriaPropertiesOnSelectedItem=function(t,e){t.attr(this._isTabBar()?"aria-selected":"aria-pressed",e?"true":"false")},t.HorizontalNavListHandler.prototype._isTabBar=function(){return this.m_widget.isTabBar()},t.HorizontalNavListHandler.prototype.HandleArrowKeys=function(t,i,n){t===e.ui.keyCode.LEFT?t=this.m_widget.isRtl()?e.ui.keyCode.DOWN:e.ui.keyCode.UP:t===e.ui.keyCode.RIGHT&&(t=this.m_widget.isRtl()?e.ui.keyCode.UP:e.ui.keyCode.DOWN);var a=s.superclass.HandleArrowKeys.call(this.m_widget,t,i,n);return this.m_widget.m_active.elem[0].scrollIntoView(!1),a},t.HorizontalNavListHandler.prototype.IsArrowKey=function(t){return t===this.m_widget.UP_KEY||t===this.m_widget.DOWN_KEY||t===this.m_widget.LEFT_KEY||t===this.m_widget.RIGHT_KEY},t.HorizontalNavListHandler.prototype.ModifyListItem=function(t,e){var i=this.m_widget.getSingleFocusableElement(t);i.attr("role",this._isTabBar()?"tab":"button"),!this._isTabBar()&&i[0].hasAttribute("aria-selected")&&(i.attr("aria-pressed","false"),i.removeAttr("aria-selected"))},t.HorizontalNavListHandler.prototype.BeforeRenderComplete=function(){var t,i,n=this;this._isTabBar()?this.m_root.attr("role","tablist"):this.m_root.attr("role","toolbar"),this.m_widget.element.attr("role","presentation"),(i=this.m_widget.element.find("."+this.m_widget.getItemElementStyleClass()+":visible")).each(function(s){t=e(this),s>0&&n._addSeparator(this,s),s===i.length-1?t.addClass(n.m_widget.getLastItemStyleClass()):t.removeClass(n.m_widget.getLastItemStyleClass())}),this.m_duringInit&&(this.m_duringInit=!1,this._handleOverflow())},t.HorizontalNavListHandler.prototype._addSeparator=function(t,i){var n=e(t),s=n.prev();i>0&&s.length&&!s.is("li."+this.m_widget.getDividerStyleClass())&&n.before('')},t.HorizontalNavListHandler.prototype.ItemInsertComplete=function(t,e){this._addSeparator(t,e.index),this._handleOverflow()},t.HorizontalNavListHandler.prototype.ItemRemoveComplete=function(t){var i=e(t),n=i.prev();if(n.length&&n.is("li."+this.m_widget.getDividerStyleClass()))n.remove();else{var s=i.next();s.is("li."+this.m_widget.getDividerStyleClass())&&s.remove()}this._handleOverflow()},t.HorizontalNavListHandler.prototype.IsSelectable=function(t){var i="aria-selected";return this._isTabBar()||(i="aria-pressed"),!(this.m_overflowMenuItem&&this.m_overflowMenuItem[0]===e(t)[0])&&this.m_widget.getFocusItem(e(t))[0].hasAttribute(i)},t.HorizontalNavListHandler.prototype.Init=function(t){this.m_root.addClass(this.m_widget.getNavListExpandedStyleClass()).addClass(this.m_widget.getHorizontalNavListStyleClass()),this.m_overflowMenuItems=[]},t.HorizontalNavListHandler.prototype.HandleClick=function(t){e(t.target).closest("."+this.m_widget.getOverflowItemStyleClass()+" a."+this.m_widget.getItemContentStyleClass()).length>0&&this._launchOverflowMenu(t)},t.HorizontalNavListHandler.prototype.HandleKeydown=function(t){e(t.target).closest("."+this.m_widget.getOverflowItemStyleClass()+" a."+this.m_widget.getItemContentStyleClass()).length>0&&t.keyCode===e.ui.keyCode.SPACE&&this._launchOverflowMenu(t)},t.HorizontalNavListHandler.prototype.NotifyAttached=function(){this._handleOverflow()},t.HorizontalNavListHandler.prototype.HandleResize=function(t,e){this.m_ignoreNextResize?this.m_ignoreNextResize=!1:this._handleOverflow()},t.HorizontalNavListHandler.prototype.SetOptions=function(t){var e,i,n=this.m_widget.GetOption("overflow"),s=this.m_widget.GetOption("truncation");t.overflow&&n!==t.overflow&&(e=t.overflow),t.truncation&&s!==t.truncation&&(i=t.truncation),(e||i)&&this._handleOverflow(e,i)},t.HorizontalNavListHandler.prototype.GetAnimationEffect=function(t){return"add"===t||"remove"===t?s.superclass.getAnimationEffect.call(this.m_widget,t+"HorizontalItem"):s.superclass.getAnimationEffect.apply(this.m_widget,arguments)},t.HorizontalNavListHandler.prototype.GetNodeBySubId=function(t){var i,n,s,a,o=null;if(t.subId===this.m_widget.getItemSubIdKey()&&this.m_overflowMenuItems.length>0)for(n=this._getOverflowMenu(),i=t.key,s=n.find(".oj-menu-item"),a=0;a0&&null!=(i=n.data("key"))&&(s={subId:this.m_widget.getItemSubIdKey(),key:i}),s)},t.HorizontalNavListHandler.prototype.OptionUpdated=function(t,e,i){"selection"===t&&this._toggleOverflowBtnSelection(e)},t.HorizontalNavListHandler.prototype.IsOptionUpdateAllowed=function(t,e,i){return"currentItem"!==t||!this.m_overflowMenuItem||this.m_overflowMenuItem.attr("id")!==e},t.HorizontalNavListHandler.prototype._handleOverflow=function(e,i){var n,s,a=-1;if(0!==(n=this._getItems()).length){if(e||(e=this.m_widget.GetOption("overflow")),i||(i=this.m_widget.GetOption("truncation")),!(s=new t._HorizontalNavListOverflowHandler(n,e,i,this)).shouldHandleOverflow())return s.unApplyTruncation(),void this._releaseContainerWidth();this.showAllItems(n,e),s.unApplyTruncation(),s.checkForOverflow()&&s.applyTruncation()&&(a=s.getOverflowThreshold()),this._applyThreshold(a),this._releaseContainerWidth()}},t.HorizontalNavListHandler.prototype.BeforeInsertItem=function(){this._fixContainerWidth()},t.HorizontalNavListHandler.prototype._fixContainerWidth=function(){var t,e;0!==(t=(e=this.m_widget.getRootElement())[0].getBoundingClientRect().width)&&(this.m_freezedCotnainerWidth=t,e.css("maxWidth",t))},t.HorizontalNavListHandler.prototype._releaseContainerWidth=function(){var t;(t=this.m_widget.getRootElement()).css("maxWidth","none"),t[0].getBoundingClientRect().width,this.m_freezedCotnainerWidth&&(this.m_ignoreNextResize=!0,this.m_freezedCotnainerWidth=null)},t.HorizontalNavListHandler.prototype.showAllItems=function(t,i){var n=this;"popup"===i&&this._showOrHideItem(this._getOverflowMenuButton(),!0),t.each(function(t,i){n._showOrHideItem(e(i),!0)})},t.HorizontalNavListHandler.prototype._getItems=function(){return this.m_root.find("."+this.m_widget.getItemElementStyleClass()+":not(."+this.m_widget.getOverflowItemStyleClass()+")")},t.HorizontalNavListHandler.prototype._hasSeparators=function(){return this.m_root.hasClass(this.m_widget.getNavListItemsDividerStyleClass())},t.HorizontalNavListHandler.prototype._showOrHideItem=function(t,e){var i;this._hasSeparators()&&(i=t.prev("."+this.m_widget.getDividerStyleClass())),e?(t.show(),i&&i.show()):(t.hide(),i&&i.hide())},t.HorizontalNavListHandler.prototype._applyThreshold=function(t){var i,n,s,a,o=this,l=this._getItems(),r=[];0!==l.length&&(this.m_root.find("."+this.m_widget.getLastItemStyleClass()).removeClass(this.m_widget.getLastItemStyleClass()),-1===t||t>=l.length?this.m_overflowMenuItem&&this._showOrHideItem(this.m_overflowMenuItem,!1):(this._addSeparator(this._getOverflowMenuButton(),l.length),this._showOrHideItem(this._getOverflowMenuButton(),!0),s=!0),l.each(function(s,a){var l=e(a);-1!==t&&t<=s?(l.hasClass("oj-focus")&&o.m_widget.ActiveAndFocus(o._getOverflowMenuButton(),null),o._showOrHideItem(l,!1),i={},r.push(i),i.key=o.m_widget.GetKey(a),i.label=o._getItemLabel(l),l.hasClass("oj-disabled")&&(i.disabled=!0)):(n=l,o._showOrHideItem(l,!0),o.m_overflowMenuItem&&o.m_overflowMenuItem.hasClass("oj-focus")&&o.m_widget.compareValues(o.m_widget.GetKey(a),o.m_widget.GetOption("currentItem"))&&o.m_widget.ActiveAndFocus(n,null))}),s?this._getOverflowMenuButton().addClass(this.m_widget.getLastItemStyleClass()):n.addClass(this.m_widget.getLastItemStyleClass()),this.m_overflowMenuItems=r,this.m_widget.ClearCache(),a=this.m_overflowMenu&&this.m_overflowMenu.is(":visible"),this._destroyOverflowMenu(),a&&this._launchOverflowMenu(null))},t.HorizontalNavListHandler.prototype._destroyOverflowMenu=function(){this.m_overflowMenu&&(this.m_overflowMenu.ojMenu("destroy"),this.m_overflowMenu.remove(),this.m_overflowMenu=null)},t.HorizontalNavListHandler.prototype._getOverflowMenuButton=function(){var t,i,n,s,a;return this.m_overflowMenuItem||(s=e(document.createElement("li")),t=e(document.createElement("a")),i=e(document.createElement("span")),n=e(document.createElement("span")),a=this._getItems(),s.uniqueId().attr("role","presentation").addClass(this.m_widget.getItemElementStyleClass()).addClass(this.m_widget.getItemStyleClass()).addClass(this.m_widget.getOverflowItemStyleClass()).addClass("oj-default").append(t),t.addClass(this.m_widget.getFocusedElementStyleClass()).addClass(this.m_widget.getItemContentStyleClass()),t.attr("role","button").attr("aria-haspopup","true").attr("aria-pressed","false").attr("tabindex","-1").attr("data-tabmod","-1").attr("href","#").append(n).append(i),this.m_root.find("ul:first").hasClass(this.m_widget.getHasIconsStyleClass())||t.addClass(this.m_widget.getHasNoIconStyleClass()),i.text(this.m_widget.ojContext.getTranslatedString("overflowItemLabel")).addClass(this.m_widget.getItemLabelStyleClass()),n.addClass(this.m_widget.getItemIconStyleClass()).addClass("oj-fwk-icon").addClass(this.m_widget.getOverflowItemIconStyleClass()),s[0].key=s.attr("id"),this.m_root.find("."+this.m_widget.GetStyleClass()).append(s),this._addSeparator(s,a.length),this.m_overflowMenuItem=s),this.m_overflowMenuItem},t.HorizontalNavListHandler.prototype._getOverflowMenu=function(){var t,i,n,s,a=this.m_overflowMenuItems;if(0===a.length)return null;if(!this.m_overflowMenu){for((s=e(document.createElement("ul"))).addClass(this.m_widget.getOverflowMenuStyleClass()).hide(),this.m_root.append(s),n=0;n0){if(t)for(i=0;i0?e.text():t.find("."+this.m_widget.getItemLabelStyleClass()+":first").text()},t._HorizontalNavListOverflowHandler=function(t,e,i,n){this._overflow=e,this._truncation=i,this._items=t,this._navlistHandler=n},t._HorizontalNavListOverflowHandler.prototype._getOverflowMenuButton=function(){return this._navlistHandler._getOverflowMenuButton()},t._HorizontalNavListOverflowHandler.prototype._getWidget=function(){return this._navlistHandler.m_widget},t._HorizontalNavListOverflowHandler.prototype.shouldHandleOverflow=function(){return"popup"===this._overflow||"progressive"===this._truncation},t._HorizontalNavListOverflowHandler.prototype.unApplyTruncation=function(){var t=this;this._items.each(function(i,n){e(n).find("."+t._getWidget().getItemLabelStyleClass()).css("max-width","")})},t._HorizontalNavListOverflowHandler.prototype.checkForOverflow=function(){return!!this.shouldHandleOverflow()&&(this._overflowData||(this._overflowData=this._collectOverflowData()),this._isOverflowed(this._overflowData.containerEdgePos,this._overflowData.itemEdgePos,0))},t._HorizontalNavListOverflowHandler.prototype.applyTruncation=function(){"progressive"===this._truncation&&this._applyLabelMaxWidth(this._overflowData);var e=this._items.last()[0].getBoundingClientRect()["ltr"===t.DomUtils.getReadingDirection()?"right":"left"];return this._isOverflowed(this._overflowData.containerEdgePos,e,0)},t._HorizontalNavListOverflowHandler.prototype.getOverflowThreshold=function(){var t=-1;return"popup"===this._overflow&&(t=this._calculateThreshold(this._overflowData)),t},t._HorizontalNavListOverflowHandler.prototype._collectOverflowData=function(){var e,i,n,s,a,o,l;return e="ltr"===t.DomUtils.getReadingDirection()?"right":"left",l=this._getWidget().ojContext.element,i=this._items.last(),"progressive"===this._truncation&&(n=this._calculateItemNonTextWidth()),o=l[0].getBoundingClientRect()[e],a=l[0].getBoundingClientRect().width,"popup"===this._overflow&&(s=this._getOverflowMenuButton()[0].getBoundingClientRect().width),{containerEdgePos:o,containerWidth:a,overflowItemWidth:s,itemEdgePos:i[0].getBoundingClientRect()[e],itemNonTextWidth:n}},t._HorizontalNavListOverflowHandler.prototype._calculateItemNonTextWidth=function(){var t,i,n=null,s=this._items,a=this;return this._getWidget().getRootElement().hasClass("."+this._getWidget().getHasIconsStyleClass())&&(s=s.filter(function(t,i){return e(i).find("."+a._getWidget().getItemIconStyleClass()).length>0})),i=(n=(t=s.filter(function(t,i){return e(i).find("."+a._getWidget().getRemovableStyleClass()).length>0}))&&t.length>0?t.last():s.last()).find("."+this._getWidget().getItemLabelStyleClass())[0].getBoundingClientRect().width,n[0].getBoundingClientRect().width-i},t._HorizontalNavListOverflowHandler.prototype._isOverflowed=function(e,i,n){return n=n||0,"ltr"===t.DomUtils.getReadingDirection()?i-e+n>.1:e-i+n>.1},t._HorizontalNavListOverflowHandler.prototype._calculateThreshold=function(e){var i,n,s,a;for(n=this._items,i="ltr"===t.DomUtils.getReadingDirection()?"right":"left",s=n[a=n.length-1].getBoundingClientRect()[i];this._isOverflowed(e.containerEdgePos,s,e.overflowItemWidth)&&a>0;)s=n[a-=1].getBoundingClientRect()[i];return a+1},t._HorizontalNavListOverflowHandler.prototype._applyLabelMaxWidth=function(t){var i=this._items,n=this,s=this._getMinLabelWidth(this._items),a=t.containerWidth/i.length-t.itemNonTextWidth;a0?parseInt(e.substring(0,e.length-2),10):0},t.CollapsibleNavListHandler=function(e,i,n){t.CollapsibleNavListHandler.superclass.constructor.call(this,e,i,n)},t.Object.createSubclass(t.CollapsibleNavListHandler,t.DefaultNavListHandler,"oj.CollapsibleNavListHandler"),t.CollapsibleNavListHandler.prototype.Destroy=function(){this.m_root.removeClass(this.m_widget.getNavListCollapsibleStyleClass()).removeClass(this.m_widget.getNavListVerticalStyleClass())},t.CollapsibleNavListHandler.prototype.Init=function(t){this.m_root.addClass(this.m_widget.getNavListCollapsibleStyleClass()).addClass(this.m_widget.getNavListVerticalStyleClass())},t.CollapsibleNavListHandler.prototype.Expand=function(t,e,i){return s.superclass.AnimateExpand.apply(this.m_widget,arguments)},t.CollapsibleNavListHandler.prototype.Collapse=function(t,e,i,n){return s.superclass.AnimateCollapse.apply(this.m_widget,arguments)},t.CollapsibleNavListHandler.prototype.HandleExpandAndCollapseKeys=function(t,i,n,s){var a=n.children("."+this.m_widget.getGroupStyleClass()).length>0;if(i===this.m_widget.LEFT_KEY||i===this.m_widget.RIGHT_KEY)return i===this.m_widget.LEFT_KEY&&!this.m_widget.isRtl()||i===this.m_widget.RIGHT_KEY&&this.m_widget.isRtl()?this.m_widget.GetState(n)===this.m_widget.STATE_EXPANDED&&this.m_widget.CollapseItem(n,t,!0,s,!0,!0):this.m_widget.GetState(n)===this.m_widget.STATE_COLLAPSED&&this.m_widget.ExpandItem(n,t,!0,s,!0,!0,!0),!0;if(a&&(i===e.ui.keyCode.ENTER||i===e.ui.keyCode.SPACE)){if(n.length<=0)return;return this.m_widget.GetState(n)===this.m_widget.STATE_COLLAPSED?this.m_widget.ExpandItem(n,null,!0,s,!0,!0,!0):this.m_widget.GetState(n)===this.m_widget.STATE_EXPANDED&&this.m_widget.CollapseItem(n,null,!0,s,!0,!0),!0}return!1},t.SlidingNavListHandler=function(e,i,n){t.SlidingNavListHandler.superclass.constructor.call(this,e,i,n),this.m_expanded=[]},t.Object.createSubclass(t.SlidingNavListHandler,t.CollapsibleNavListHandler,"oj.SlidingNavListHandler"),t.SlidingNavListHandler.prototype.Destroy=function(){this.m_root.removeClass("oj-navigationlist-slider").removeClass(this.m_widget.getNavListVerticalStyleClass()),this._toolbar.remove()},t.SlidingNavListHandler.prototype._slideAnimation=function(t,e,i,n,s){var a,o=this,l=this.m_widget.getRootElement(),r=(this.m_widget.isRtl(),this.m_widget.getRootElement().hasClass("oj-focus-ancestor"));a=e?"sliderExpand":"sliderCollapse",this.m_widget.StartAnimation(l.get(0),a,this.m_widget.getAnimationEffect(a)).then(function(){o._slideAnimationComplete(t,e,i,n,r),s(null)})},t.SlidingNavListHandler.prototype._slideAnimationComplete=function(t,e,i,n,s){null!==this.m_widget.m_contentHandler&&(i&&(s&&this.m_widget.getRootElement().addClass("oj-focus-ancestor"),n&&0===n.button&&this.m_widget.AvoidFocusHighLight(!0),this.m_widget.SetCurrentItem(i,n),this.m_widget.AvoidFocusHighLight(!1)),e?this.m_widget.AnimateExpandComplete(t.children("."+this.m_widget.getGroupStyleClass())):this.m_widget.AnimateCollapseComplete(t.children("."+this.m_widget.getGroupStyleClass())))},t.SlidingNavListHandler.prototype.Expand=function(t,i,n){var s,a,o=new Promise(function(t,e){s=t}),l=e(t).parents(".oj-navigationlist-item-element:first"),r=l.children("."+this.m_widget.getGroupStyleClass()),d=null,h=l.closest("."+this.m_widget.SLIDING_NAVLIST_CURRENT_STYLE_CLASS);if(h.length>0){h.removeClass(this.m_widget.SLIDING_NAVLIST_CURRENT_STYLE_CLASS),l.addClass(this.m_widget.SLIDING_NAVLIST_CURRENT_STYLE_CLASS),d=r.find("."+this.m_widget.getItemElementStyleClass()+":eq(0)");var _=l.parentsUntil(h,"ul");_=h.is(this.m_widget.element)?_.get().concat(h.get()):_.get();var u,m=this;(_=e(_.reverse())).each(function(t,i){a=e(i).is(m.m_widget.element)?m.m_widget.getRootLabel():m.m_widget.getItemLabel(e(i).parent()),u=t===_.length-1?l:e(_.get(t+1)).parent(),m._addItemToHviewMenu(m.m_widget.GetKey(u[0]),m.m_widget.getItemLabel(u),a),m.m_expanded.push(u)})}return i?this._slideAnimation(l,!0,d,n,s):(this._slideAnimationComplete(l,!0,d,n,!1),s(null)),l.siblings().attr("aria-hidden","true"),l.children("."+this.m_widget.getGroupItemStyleClass()).children("."+this.m_widget.getItemContentStyleClass()).attr("aria-hidden","true"),r.removeAttr("aria-hidden"),t.css("display",""),l.addClass("oj-skipfocus"),o},t.SlidingNavListHandler.prototype.Collapse=function(t,e,i,n){var s,a=new Promise(function(t,e){s=t}),o=t.children("."+this.m_widget.getGroupStyleClass()),l=t.parent();return t.children("."+this.m_widget.getGroupItemStyleClass()).children("."+this.m_widget.getItemContentStyleClass()).removeAttr("aria-hidden"),o.attr("aria-hidden","true"),t.siblings().removeAttr("aria-hidden"),t.removeClass("oj-skipfocus"),t.removeClass(this.m_widget.SLIDING_NAVLIST_CURRENT_STYLE_CLASS),0===t.closest("."+this.m_widget.SLIDING_NAVLIST_CURRENT_STYLE_CLASS).length&&(l.closest("."+this.m_widget.getItemElementStyleClass()).addClass(this.m_widget.SLIDING_NAVLIST_CURRENT_STYLE_CLASS),this.m_widget.element.is(l)&&this.m_widget.element.addClass(this.m_widget.SLIDING_NAVLIST_CURRENT_STYLE_CLASS)),i?this._slideAnimation(t,!1,o.parent(),n,s):(this._slideAnimationComplete(t,!1,o.parent(),n,!1),s(null)),this._removeItemFromHviewMenu(),a},t.SlidingNavListHandler.prototype.UpdateAriaPropertiesOnSelectedItem=function(t,e){e?t.attr("aria-describedby",this._selectedLabelId):t.removeAttr("aria-describedby")},t.SlidingNavListHandler.prototype.GetState=function(t){var e=this.m_widget.getFocusItem(t).attr("aria-expanded");return"true"===e?this.m_widget.STATE_EXPANDED:"false"===e?this.m_widget.STATE_COLLAPSED:this.m_widget.STATE_NONE},t.SlidingNavListHandler.prototype.SetState=function(t,e){e===this.m_widget.STATE_EXPANDED?(this.m_widget.getFocusItem(t).attr("aria-expanded","true"),t.removeClass(this.m_widget.COLLAPSED_STYLE_CLASS).addClass(this.m_widget.EXPANDED_STYLE_CLASS)):e===this.m_widget.STATE_COLLAPSED&&(this.m_widget.getFocusItem(t).attr("aria-expanded","false"),t.removeClass(this.m_widget.EXPANDED_STYLE_CLASS).addClass(this.m_widget.COLLAPSED_STYLE_CLASS))},t.SlidingNavListHandler.prototype.ModifyListItem=function(t,e){var i=this.m_widget.getFocusItem(t);t.attr("role","presentation"),i.attr("role","menuitem"),e.attr("id")||e.uniqueId();var n=t.children("."+this.m_widget.getGroupStyleClass());n.length>0&&(i.attr("aria-haspopup","true"),n.attr("role","menu"),n.css("display",""),t.removeAttr("aria-expanded"),i.attr("aria-expanded","false"))},t.SlidingNavListHandler.prototype.BeforeRenderComplete=function(){this.m_root.attr("role","menu"),this.m_widget.element.attr("role","presentation")},t.SlidingNavListHandler.prototype.Init=function(t){this.m_root.addClass("oj-navigationlist-slider").addClass(this.m_widget.getNavListVerticalStyleClass()),t.element.addClass("oj-navigationlist-current"),this._buildSlidingNavListHeader(t),this._initializeHierarchicalView()},t.SlidingNavListHandler.prototype.HandleClick=function(t){e(t.target).closest(".oj-navigationlist-previous-link, .oj-navigationlist-previous-button").length>0&&this.CollapseCurrentList(t)},t.SlidingNavListHandler.prototype.HandleKeydown=function(t){e(t.target).closest(".oj-navigationlist-previous-link, .oj-navigationlist-previous-button").length>0&&t.keyCode===e.ui.keyCode.ENTER&&this.CollapseCurrentList(t),e(t.target).closest("."+this.m_widget.GetStyleClass()).length>0&&(t.keyCode!==e.ui.keyCode.ESCAPE||t.isDefaultPrevented()||this.CollapseCurrentList(t))},t.SlidingNavListHandler.prototype._buildSlidingNavListHeader=function(t){var i;this._toolbar=e(document.createElement("div")),this._toolbar.addClass("oj-navigationlist-toolbar"),this._previousLink=e(document.createElement("a")),this._prevButton=e(document.createElement("a")),this._prevButton.addClass("oj-navigationlist-previous-button"),this._prevButton.css("visibility","hidden").attr("tabindex","-1"),this._previousLink.addClass("oj-navigationlist-previous-link").attr("tabindex","-1"),this._headerLabel=e(document.createElement("label")),this._headerLabel.addClass("oj-navigationlist-current-header").text(this.m_widget.getRootLabel()),this._vSeparator=e(document.createElement("span")),this._vSeparator.attr("role","separator").attr("aria-orientation","vertical").addClass("oj-navigationlist-toolbar-separator"),this._hviewBtn=e(document.createElement("button")),this._hviewBtn.addClass("oj-navigationlist-hierarchical-button").attr("tabindex","-1"),this._hviewMenu=e(document.createElement("ul")),this._hviewMenu.addClass("oj-navigationlist-hierarchical-menu").hide(),(i=e(document.createElement("label"))).uniqueId().addClass("oj-helper-hidden-accessible").attr("aria-hidden","true"),this._selectedLabelId=i.attr("id"),i.text(this.m_component.getTranslatedString("selectedLabel")),this._previousLink.append(this._headerLabel),this._toolbar.append(this._prevButton),this._toolbar.append(this._previousLink).append(this._vSeparator).append(this._hviewBtn).append(this._hviewMenu).append(i),this.m_root.prepend(this._toolbar),this._showOrHideHierarchyMenu(t.hierarchyMenuDisplayThresholdLevel)},t.SlidingNavListHandler.prototype.CollapseCurrentList=function(t){var e=this.m_expanded.pop();e&&this.m_widget.CollapseItem(e,t,!0,null,!0,!0)},t.SlidingNavListHandler.prototype._initializeHierarchicalView=function(){var t=this,i=this._hviewMenu.uniqueId().attr("id");this._hviewMenu.ojMenu({openOptions:{position:{my:"end top",at:"end bottom"}},select:function(i,n){var s,a,o=n.item.nextAll(),l=t.m_expanded,r=n.item.data("key");for(t.m_widget.signalTaskStart();l.length>0&&(a=l.pop(),s=t.m_widget.GetKey(a[0]),t.m_widget.CollapseItem(e(a),i,!0,s,!0,!0),!t.m_widget.compareValues(r,s)););o.remove(),n.item.remove(),t._hviewMenu.ojMenu("refresh"),t.m_widget.signalTaskEnd()}}),this._hviewBtn.ojButton({label:this.m_component.getTranslatedString("hierMenuBtnLabel"),display:"icons",icons:{start:"oj-fwk-icon oj-hier-icon"},menu:"#"+i,disabled:!0,chroming:"half"}),this._prevButton.ojButton({label:this.m_component.getTranslatedString("previousIcon"),display:"icons",icons:{start:"oj-navigationlist-previous-icon oj-component-icon oj-clickable-icon-nocontext"},chroming:"half"})},t.SlidingNavListHandler.prototype._addItemToHviewMenu=function(t,i,n){var s;if(this._hviewBtn){var a=this._hviewMenu.find("li").length,o=e(document.createElement("li")),l=e(document.createElement("a"));if(l.attr("href","#"),o.append(l),a>0){for(s=0;s0&&l.append(e(document.createElement("span")).addClass("oj-navigationlist-hvitem-space"));l.append(e(document.createElement("span")).addClass("oj-menu-item-icon oj-icon oj-navigationlist-level-indicator"))}var r=e(document.createElement("span")).addClass("oj-navigationlist-hierarchical-menu-label");r.text(n),l.append(r),o.data("key",t),this._hviewMenu.append(o),this._hviewMenu.ojMenu("refresh"),this._showOrHideHierarchyMenu(this.m_widget.GetOption("hierarchyMenuDisplayThresholdLevel")),this._hviewBtn.ojButton("option","disabled",!1),this._prevButton.css("visibility","visible"),this.m_widget.getRootElement().hasClass("oj-focus-ancestor")&&this._prevButton.attr("tabindex","0"),this._headerLabel.text(i)}},t.SlidingNavListHandler.prototype.SetOptions=function(t){void 0!==t.hierarchyMenuDisplayThresholdLevel&&(this.m_widget.GetOption("hierarchyMenuDisplayThresholdLevel")!==t.hierarchyMenuDisplayThresholdLevel&&this._showOrHideHierarchyMenu(t.hierarchyMenuDisplayThresholdLevel))},t.SlidingNavListHandler.prototype._showOrHideHierarchyMenu=function(t){var e=this._hviewMenu.find("li").length;-1===t||e=t&&(this._vSeparator.css("visibility","visible"),this._hviewBtn.css("visibility","visible"))},t.SlidingNavListHandler.prototype._removeItemFromHviewMenu=function(){if(this._hviewBtn){var t=this._hviewMenu.find("li").last().remove();this._hviewMenu.ojMenu("refresh"),this._showOrHideHierarchyMenu(this.m_widget.GetOption("hierarchyMenuDisplayThresholdLevel")),0===this._hviewMenu.children("li").length?(this._hviewBtn.ojButton("option","disabled",!0),this._prevButton.css("visibility","hidden"),this._prevButton.attr("tabindex","-1"),this._headerLabel.text(this.m_widget.getRootLabel())):this._headerLabel.text(t.children("a").text())}},t.SlidingNavListHandler.prototype.RestoreItem=function(t,e,i){t.removeClass(this.m_widget.SLIDING_NAVLIST_CURRENT_STYLE_CLASS),e.removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-describedby").removeAttr("aria-hidden")},t.SlidingNavListHandler.prototype._makeToolbarItemsFocusable=function(t){t?(this._hviewMenu.find("li").length&&this._prevButton.attr("tabindex","0"),this._hviewBtn.attr("tabindex","0")):(this._prevButton.attr("tabindex","-1"),this._hviewBtn.attr("tabindex","-1"))},t.SlidingNavListHandler.prototype.HandleFocus=function(t){e.contains(this._toolbar.get(0),t.target)||this._hviewMenu.get(0)===t.relatedTarget||(this._makeToolbarItemsFocusable(!0),s.superclass.HandleFocus.apply(this.m_widget,arguments))},t.SlidingNavListHandler.prototype.HandleBlur=function(t){e.contains(this._toolbar.get(0),t.relatedTarget)||this._hviewMenu.get(0)===t.relatedTarget?this.m_widget.UnhighlightActive():(null!=t.relatedTarget&&e.contains(this.m_root.get(0),t.relatedTarget)||this._makeToolbarItemsFocusable(!1),s.superclass.HandleBlur.apply(this.m_widget,arguments))},t.SlidingNavListHandler.prototype.GetNodeBySubId=function(t){return"oj-navigationlist-previous-link"===t.subId?this._prevButton?this._prevButton[0]:null:"oj-navigationlist-hierarchical-button"===t.subId?this._hviewBtn?this._hviewBtn[0]:null:"oj-navigationlist-hierarchical-menu"===t.subId&&this._hviewMenu?this._hviewMenu[0]:null},t.SlidingNavListHandler.prototype.GetSubIdByNode=function(t){return e(t).closest(this._prevButton).length>0?{subId:"oj-navigationlist-previous-link"}:e(t).closest(this._hviewBtn).length>0?{subId:"oj-navigationlist-hierarchical-button"}:e(t).closest(this._hviewMenu).length>0?{subId:"oj-navigationlist-hierarchical-menu"}:null};var s=function(i,n){var s=function(){};return t.Object.createSubclass(s,i,""),e.extend(s.prototype,n),s}(t._ojListView,{OPTION_DRILL_MODE:"drillMode",OPTION_DRILL_MODE_NONE:"none",OPTION_DRILL_MODE_COLLAPSIBLE:"collapsible",OPTION_DRILL_MODE_SLIDING:"sliding",OPTION_DISPLAY:"display",OPTION_DISPLAY_ICONS:"icons",OPTION_DISPLAY_ALL:"all",OPTION_EDGE:"edge",OPTION_EDGE_TOP:"top",OPTION_EDGE_END:"end",OPTION_EDGE_START:"start",OPTION_EDGE_BOTTOM:"bottom",OPTION_SELECTION:"selection",OPTION_CURRENT_ITEM:"currentItem",TAG_NAME_TAB_BAR:"oj-tab-bar",NAVLIST_ITEM_SUBID_KEY:{navlist:"oj-navigationlist-item",tabbar:"oj-tabbar-item"},NAVLIST_EXPANDED_STYLE_CLASS:{navlist:"oj-navigationlist-expanded",tabbar:"oj-tabbar-expanded"},NAVLIST_COLLAPSIBLE_STYLE_CLASS:{navlist:"oj-navigationlist-collapsible",tabbar:"oj-tabbar-collapsible"},NAVLIST_VERTICAL_STYLE_CLASS:{navlist:"oj-navigationlist-vertical",tabbar:"oj-tabbar-vertical"},ITEM_CONTENT_STYLE_CLASS:{navlist:"oj-navigationlist-item-content",tabbar:"oj-tabbar-item-content"},NAVLIST_DIVIDERS_STYLE_CLASS:{navlist:"oj-navigationlist-item-dividers",tabbar:"oj-tabbar-item-dividers"},LAST_ITEM_STYLE_CLASS:{navlist:"oj-navigationlist-item-last-child",tabbar:"oj-tabbar-item-last-child"},EXPANDED_STYLE_CLASS:"oj-expanded",COLLAPSED_STYLE_CLASS:"oj-collapsed",SLIDING_NAVLIST_CURRENT_STYLE_CLASS:"oj-navigationlist-current",DIVIDER_STYLE_CLASS:{navlist:"oj-navigationlist-divider",tabbar:"oj-tabbar-divider"},NAVLIST_OVERFLOW_MENU_ITEM:{navlist:"oj-navigationlist-overflow-menu-item",tabbar:"oj-tabbar-overflow-menu-item"},NAVLIST_OVERFLOW_MENU:{navlist:"oj-navigationlist-overflow-menu",tabbar:"oj-tabbar-overflow-menu"},NAVLIST_OVERFLOW_ITEM_ICON:{navlist:"oj-navigationlist-overflow-item-icon",tabbar:"oj-tabbar-overflow-item-icon"},_CATEGORY_DIVIDER_STYLE_CLASS:{navlist:"oj-navigationlist-category-divider",tabbar:"oj-tabbar-category-divider"},_ITEM_LABEL_STYLE_CLASS:{navlist:"oj-navigationlist-item-label",tabbar:"oj-tabbar-item-label"},_ICON_ONLY_STYLE_CLASS:{navlist:"oj-navigationlist-icon-only",tabbar:"oj-tabbar-icon-only"},_ITEM_ICON_STYLE_CLASS:{navlist:"oj-navigationlist-item-icon",tabbar:"oj-tabbar-item-icon"},_HORIZONTAL_NAVLIST_STYLE_CLASS:{navlist:"oj-navigationlist-horizontal",tabbar:"oj-tabbar-horizontal"},_NAVLIST_END_EDGE_STYLE_CLASS:{navlist:"oj-navigationlist-vertical-end",tabbar:"oj-tabbar-vertical-end"},_NAVLIST_BOTTOM_EDGE_STYLE_CLASS:{navlist:"oj-navigationlist-horizontal-bottom",tabbar:"oj-tabbar-horizontal-bottom"},_NAVLIST_HAS_ICONS:{navlist:"oj-navigationlist-has-icons",tabbar:"oj-tabbar-has-icons"},_NAVLIST_ITEM_HAS_NO_ICON:{navlist:"oj-navigationlist-item-no-icon",tabbar:"oj-tabbar-item-no-icon"},_NAVLIST_ITEM_TITLE:{navlist:"oj-navigationlist-item-title",tabbar:"oj-tabbar-item-title"},_NAVLIST_STYLE_CLASS:{navlist:"oj-navigationlist",tabbar:"oj-tabbar"},_NAVLIST_TOUCH_STYLE_CLASS:{navlist:"oj-navigationlist-touch",tabbar:"oj-tabbar-touch"},_NAVLIST_LISTVIEW_CONTAINER_STYLE_CLASS:{navlist:"oj-navigationlist-listview-container",tabbar:"oj-tabbar-listview-container"},_IS_TITLE_ATTR_ADDED_DUE_TO_TRUNCATION:"IsTitleAttrDueToTruncation",_APPLICATION_LEVEL_NAV_STYLE_CLASS:"oj-navigationlist-app-level",_PAGE_LEVEL_NAV_STYLE_CLASS:"oj-navigationlist-page-level",_NAVLIST_ITEM_ICON_HAS_TITLE:"navigationListItemIconHastitle",_NAVLIST_NO_FOLLOW_LINK_CLASS:{navlist:"oj-navigationlist-nofollow-link",tabbar:"oj-tabbar-nofollow-link"},_CONTAINER_STYLE_CLASS:{navlist:"oj-navigationlist-listview",tabbar:"oj-tabbar-listview"},_ELEMENT_STYLE_CLASS:{navlist:"oj-navigationlist-element",tabbar:"oj-tabbar-element"},_ELEMENT_EMPTY_TEXT_STYLE_CLASS:{navlist:"oj-navigationlist-empty-text",tabbar:"oj-tabbar-empty-text"},_ELEMENT_NO_DATA_MSG_STYLE_CLASS:{navlist:"oj-navigationlist-no-data-message",tabbar:"oj-tabbar-no-data-message"},_FOCUSED_ELEMENT_STYLE_CLASS:{navlist:"oj-navigationlist-focused-element",tabbar:"oj-tabbar-focused-element"},_ITEM_ELEMENT_STYLE_CLASS:{navlist:"oj-navigationlist-item-element",tabbar:"oj-tabbar-item-element"},_ITEM_STYLE_CLASS:{navlist:"oj-navigationlist-item",tabbar:"oj-tabbar-item"},_OPTION_DEFAULT_STYLE_CLASS:{navlist:"oj-navigationlist-option-defaults",tabbar:"oj-tabbar-option-defaults"},getItemLabel:function(t){var i=this.getItemContentElement(t);return i.is("a")?e.trim(i.text()):e.trim(i.find("."+this.getItemTitleStyleClass()).text())},getItemContentElement:function(t){var e=t.children("."+this.getItemContentStyleClass());return 0===e.length&&0===(e=t.children("."+this.getGroupItemStyleClass()).children("."+this.getItemContentStyleClass())).length&&(e=t.children("."+this.getGroupItemStyleClass()).children(":not(."+this.getExpandIconStyleClass()+"):not(."+this.getCollapseIconStyleClass()+")")),e},isRtl:function(){return"rtl"===this.ojContext._GetReadingDirection()},_initNavigationMode:function(t){t[0].tagName.toLowerCase()===this.TAG_NAME_TAB_BAR?this._navigationMode="tabbar":this._navigationMode="navlist"},_getNavigationMode:function(){return this._navigationMode},renderComplete:function(){this.m_listHandler.BeforeRenderComplete(),s.superclass.renderComplete.apply(this,arguments)},itemInsertComplete:function(t,e){this.m_listHandler.ItemInsertComplete(t,e)},itemRemoveComplete:function(t){this.m_listHandler.ItemRemoveComplete(t),s.superclass.itemRemoveComplete.apply(this,arguments)},_restoreContent:function(t){var i,n,s,a,o,l,r=t.children();for(t.removeAttr("style").removeClass(this.getHasIconsStyleClass()).removeAttr("aria-hidden"),i=0;i0&&(a.removeAttr("role"),a.removeAttr("aria-label"),this._removeToolTipOnIcon(a)),n.removeClass("oj-default").removeAttr("role").removeAttr("aria-disabled").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-pressed"),(o=this.getFocusItem(n)).removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-pressed"),s.children("."+this.getItemLabelStyleClass()).contents().unwrap(),o.data(this._IS_TITLE_ATTR_ADDED_DUE_TO_TRUNCATION)&&o.removeAttr("title"),(l=n.children("ul")).length>0?(this.m_listHandler.RestoreItem(n,s,l),this._restoreContent(l)):this.m_listHandler.RestoreItem(n,s))},GetDnDContext:function(){if(void 0!==t.NavigationListDndContext&&this.ojContext.element[0].tagName.toLowerCase()===this.TAG_NAME_TAB_BAR)return new t.NavigationListDndContext(this)},IsNodeEditableOrClickable:function(t){return!(t.hasClass(this.getItemContentStyleClass())||t.hasClass(this.getExpandIconStyleClass())||t.hasClass(this.getCollapseIconStyleClass()))&&s.superclass.IsNodeEditableOrClickable.apply(this,arguments)},IsElementEditableOrClickable:function(t){return t.prop("nodeName").match(/^INPUT|SELECT|OPTION|BUTTON|^A\b|TEXTAREA/)&&!t.hasClass(this.getItemContentStyleClass())||t.hasClass("oj-component")},_focusable:function(t){return e(t.data).is("li")?!e(t.data).hasClass("oj-disabled"):!e(t.parentElement).hasClass("oj-disabled")},_prepareListViewOptions:function(t){var i=e.extend({},t);return i.drillMode="none"!==t.drillMode?"collapsible":"none",i.selection=null!==t.selection?[t.selection]:[],i.selectionMode="single",i.item=e.extend({focusable:this._focusable},t.item),i.element=this._list,i},getRootLabel:function(){return this.ojContext.options.rootLabel?this.ojContext.options.rootLabel:this.ojContext.getTranslatedString("defaultRootLabel")},SetAriaProperties:function(){this.ojContext.element.attr("aria-multiselectable",!1)},HandleFocus:function(t){return this.m_listHandler.HandleFocus(t)},HandleBlur:function(t){return this.m_listHandler.HandleBlur(t)},SetRootElementTabIndex:function(){this.ojContext.element.attr("tabIndex",0)},RemoveRootElementTabIndex:function(){this.ojContext.element.removeAttr("tabIndex")},UnsetAriaProperties:function(){this.ojContext.element.removeAttr("aria-activedescendant").removeAttr("aria-multiselectable")},ShouldUseGridRole:function(){return!1},init:function(i){var n,a=this,o=i.ojContext.element;this._initNavigationMode(o),o.addClass(this.getNavListStyleClass()),t.DomUtils.isTouchSupported()&&o.addClass(this.getNavListTouchStyleClass()),this._list=o.children("ul:first"),0===this._list.length&&(this._list=e(document.createElement("ul")),o.append(this._list));var l=e(document.createElement("div"));l.addClass(this.getNavListContainerStyleClass()),l.attr("role","presentation"),this._list.wrap(l),n=this._prepareListViewOptions(i),s.superclass.init.call(this,n),this.getRootElement().attr("role","presentation"),this.element.removeClass("oj-component-initnode"),this.ojContext._on(this.ojContext.element,{click:function(t){a.m_listHandler.HandleClick(t)},keydown:function(t){a.m_listHandler.HandleKeydown(t)},mouseup:function(t){a._clearActiveState(t)},mouseover:function(t){if(e(t.target).closest("a."+a.getItemContentStyleClass()).length>0){var i=e(t.target).closest("a."+a.getItemContentStyleClass()),n=i.find("."+a.getItemLabelStyleClass());n[0].offsetWidth0){var i=e(t.target).closest("a."+a.getItemContentStyleClass());i.data(a._IS_TITLE_ATTR_ADDED_DUE_TO_TRUNCATION)&&(i.removeData(a._IS_TITLE_ATTR_ADDED_DUE_TO_TRUNCATION),i.removeAttr("title")),a._clearActiveState(t)}}})},_initListHandler:function(){var e,i;i=this.ojContext.options.drillMode,e=this.ojContext.options.edge,i===this.OPTION_DRILL_MODE_SLIDING?this.m_listHandler=new t.SlidingNavListHandler(this,this.ojContext.element,this.ojContext):i===this.OPTION_DRILL_MODE_COLLAPSIBLE?this.m_listHandler=new t.CollapsibleNavListHandler(this,this.ojContext.element,this.ojContext):i!==this.OPTION_DRILL_MODE_NONE||e!==this.OPTION_EDGE_TOP&&e!==this.OPTION_EDGE_BOTTOM?this.m_listHandler=new t.DefaultNavListHandler(this,this.ojContext.element,this.ojContext):this.m_listHandler=new t.HorizontalNavListHandler(this,this.ojContext.element,this.ojContext),this.m_listHandler.Init(this.options);var n=this.ojContext.options.navigationLevel;this._setNavigationLevel(n)},_setNavigationLevel:function(t){"none"===this.ojContext.options.drillMode&&("application"===t||"oj-navigation-list"===this.ojContext.element[0].tagName.toLowerCase()?(this.ojContext.element.addClass(this._APPLICATION_LEVEL_NAV_STYLE_CLASS),this.ojContext.element.removeClass(this._PAGE_LEVEL_NAV_STYLE_CLASS)):"page"===t&&(this.ojContext.element.addClass(this._PAGE_LEVEL_NAV_STYLE_CLASS),this.ojContext.element.removeClass(this._APPLICATION_LEVEL_NAV_STYLE_CLASS)))},_clearActiveState:function(t){var i=this.FindItem(e(t.target));null!=i&&this.HighlightUnhighlightElem(i,"oj-active",!1)},afterCreate:function(){this._initListHandler(),s.superclass.afterCreate.apply(this,arguments)},getAnimationEffect:function(t){return this.m_listHandler.GetAnimationEffect(t)},notifyAttached:function(){s.superclass.notifyAttached.apply(this,arguments),this.m_listHandler.NotifyAttached()},HandleResize:function(t,e){s.superclass.HandleResize.apply(this,arguments),t>0&&e>0&&null!=this.m_listHandler&&this.m_listHandler.HandleResize(t,e)},BeforeInsertItem:function(){this.m_listHandler.BeforeInsertItem()},HandleMouseDownOrTouchStart:function(t){s.superclass.HandleMouseDownOrTouchStart.apply(this,arguments);var i=this.FindItem(e(t.target));i&&!i.hasClass("oj-disabled")&&this.HighlightUnhighlightElem(i,"oj-active",!0)},HandleTouchEndOrCancel:function(t){this._clearActiveState(t),s.superclass.HandleTouchEndOrCancel.apply(this,arguments)},getItemContentStyleClass:function(){return this.ITEM_CONTENT_STYLE_CLASS[this._getNavigationMode()]},getNavListExpandedStyleClass:function(){return this.NAVLIST_EXPANDED_STYLE_CLASS[this._getNavigationMode()]},getNavListCollapsibleStyleClass:function(){return this.NAVLIST_COLLAPSIBLE_STYLE_CLASS[this._getNavigationMode()]},getNavListVerticalStyleClass:function(){return this.NAVLIST_VERTICAL_STYLE_CLASS[this._getNavigationMode()]},getNavListItemsDividerStyleClass:function(){return this.NAVLIST_DIVIDERS_STYLE_CLASS[this._getNavigationMode()]},getLastItemStyleClass:function(){return this.LAST_ITEM_STYLE_CLASS[this._getNavigationMode()]},getDividerStyleClass:function(){return this.DIVIDER_STYLE_CLASS[this._getNavigationMode()]},getOverflowItemStyleClass:function(){return this.NAVLIST_OVERFLOW_MENU_ITEM[this._getNavigationMode()]},getOverflowMenuStyleClass:function(){return this.NAVLIST_OVERFLOW_MENU[this._getNavigationMode()]},getOverflowItemIconStyleClass:function(){return this.NAVLIST_OVERFLOW_ITEM_ICON[this._getNavigationMode()]},getCategoryDividerStyleClass:function(){return this._CATEGORY_DIVIDER_STYLE_CLASS[this._getNavigationMode()]},getItemLabelStyleClass:function(){return this._ITEM_LABEL_STYLE_CLASS[this._getNavigationMode()]},getIconOnlyStyleClass:function(){return this._ICON_ONLY_STYLE_CLASS[this._getNavigationMode()]},getItemIconStyleClass:function(){return this._ITEM_ICON_STYLE_CLASS[this._getNavigationMode()]},getHorizontalNavListStyleClass:function(){return this._HORIZONTAL_NAVLIST_STYLE_CLASS[this._getNavigationMode()]},getNavListEndEdgeStyleClass:function(){return this._NAVLIST_END_EDGE_STYLE_CLASS[this._getNavigationMode()]},getNavListBottomEdgeStyleClass:function(){return this._NAVLIST_BOTTOM_EDGE_STYLE_CLASS[this._getNavigationMode()]},getHasIconsStyleClass:function(){return this._NAVLIST_HAS_ICONS[this._getNavigationMode()]},getHasNoIconStyleClass:function(){return this._NAVLIST_ITEM_HAS_NO_ICON[this._getNavigationMode()]},getItemTitleStyleClass:function(){return this._NAVLIST_ITEM_TITLE[this._getNavigationMode()]},getNavListStyleClass:function(){return this._NAVLIST_STYLE_CLASS[this._getNavigationMode()]},getNavListTouchStyleClass:function(){return this._NAVLIST_TOUCH_STYLE_CLASS[this._getNavigationMode()]},getNavListContainerStyleClass:function(){return this._NAVLIST_LISTVIEW_CONTAINER_STYLE_CLASS[this._getNavigationMode()]},getNoFollowLinkStyleClass:function(){return this._NAVLIST_NO_FOLLOW_LINK_CLASS[this._getNavigationMode()]},getItemSubIdKey:function(){return this.isTabBar()?this.NAVLIST_ITEM_SUBID_KEY.tabbar:this.NAVLIST_ITEM_SUBID_KEY.navlist},GetContainerStyleClass:function(){return this._CONTAINER_STYLE_CLASS[this._getNavigationMode()]},GetStyleClass:function(){return this._ELEMENT_STYLE_CLASS[this._getNavigationMode()]},getEmptyTextMarkerClass:function(){return this._ELEMENT_EMPTY_TEXT_STYLE_CLASS[this._getNavigationMode()]},getEmptyTextStyleClass:function(){return this._ELEMENT_NO_DATA_MSG_STYLE_CLASS[this._getNavigationMode()]},getNavListRemoveIcon:function(){return"oj-tabbar-remove-icon"},getNavListRemoveCommand:function(){return"oj-tabbar-remove"},getRemovableStyleClass:function(){return"oj-removable"},getItemStyleClass:function(){return this._ITEM_STYLE_CLASS[this._getNavigationMode()]},getFocusedElementStyleClass:function(){return this._FOCUSED_ELEMENT_STYLE_CLASS[this._getNavigationMode()]},getItemElementStyleClass:function(){return this._ITEM_ELEMENT_STYLE_CLASS[this._getNavigationMode()]},getCollapseIconStyleClass:function(){return"oj-navigationlist-collapse-icon"},getExpandIconStyleClass:function(){return"oj-navigationlist-expand-icon"},getDepthStyleClass:function(t){return"oj-navigationlist-depth-"+t},getGroupItemStyleClass:function(){return"oj-navigationlist-group-item"},getGroupStyleClass:function(){return"oj-navigationlist-group"},getGroupExpandStyleClass:function(){return"oj-navigationlist-collapsible-transition"},getGroupCollapseStyleClass:function(){return this.getGroupExpandStyleClass()},getOptionDefaultsStyleClass:function(){return this._OPTION_DEFAULT_STYLE_CLASS[this._getNavigationMode()]},AnimateExpand:function(t,e,i){return this.m_listHandler.Expand(t,e,i)},AnimateCollapse:function(t,e,i,n){return this.m_listHandler.Collapse(t,e,i,n)},HandleArrowKeys:function(t,e,i){return this.m_listHandler.HandleArrowKeys(t,e,i)},IsArrowKey:function(t){return this.m_listHandler.IsArrowKey(t)},GetState:function(t){return this.m_listHandler.GetState(t)},SetState:function(t,e){this.m_listHandler.SetState(t,e)},HandleMouseClick:function(t){var i=e(t.target),n=this.FindItem(i);if(null!=n&&0!==n.length)if(i.hasClass(this.getNavListRemoveIcon())&&this.isTabBar())this._handleRemove(t,n);else if(this.SkipFocus(n))t.preventDefault();else if(!this.IsNodeEditableOrClickable(i)){var a=this.getItemContentElement(n).attr("href");a&&"#"!==a&&0===t.button&&(t.shiftKey||t.ctrlKey)||(s.superclass.HandleMouseClick.apply(this,arguments),t.preventDefault())}},HandleKeyDown:function(t){var i,n,s,a;if(this.m_active)if(i=t.keyCode,n=this.m_active.elem,s=this.m_active.key,i===e.ui.keyCode.HOME||i===e.ui.keyCode.END)a=i===e.ui.keyCode.HOME?this.element.find("."+this.getItemContentStyleClass()+":visible").first().closest("."+this.getItemElementStyleClass()):this.element.find("."+this.getItemContentStyleClass()+":visible").last().closest("."+this.getItemElementStyleClass()),this.SetCurrentItem(a,t),t.preventDefault();else if(i===e.ui.keyCode.DELETE&&this.isTabBar())this._handleRemove(t,n);else{var o=this.HandleSelectionOrActiveKeyDown(t),l=this.m_listHandler.HandleExpandAndCollapseKeys(t,i,n,s);(o=o||l||null!=this.m_dndContext&&this.m_dndContext.HandleKeyDown(t))&&t.preventDefault()}},AvoidFocusHighLight:function(t){this._avoidFocusHighLight=t},RecentPointerCallback:function(){var t=this;return function(){return!!t._avoidFocusHighLight}},ShouldApplyHighlight:function(){return!0},ToggleSelection:function(t,e,i){var n=this.m_active.elem;this.IsSelectable(n[0])&&(this._isSelected(n)||this._fireBeforeSelectEvent(t,n)&&(s.superclass.ToggleSelection.apply(this,arguments),this._initiateNavigation(n)))},HighlightUnhighlightElem:function(t,i,n){var s;t=e(t),"oj-selected"===i&&this.m_listHandler.UpdateAriaPropertiesOnSelectedItem(this.getFocusItem(t),n),(s=t.children("."+this.getGroupItemStyleClass())).length>0&&(t=e(s[0])),"oj-focus"===i?n?this._focusInHandler(t):this._focusOutHandler(t):n?t.addClass(i):t.removeClass(i),t.hasClass("oj-selected")||t.hasClass("oj-hover")||t.hasClass("oj-active")||t.hasClass("oj-disabled")?t.removeClass("oj-default"):t.addClass("oj-default")},IsSelectable:function(t){return!e(t).hasClass("oj-disabled")&&this.m_listHandler.IsSelectable(e(t))},Trigger:function(t,e,i){return"ready"===t||this.ojContext._trigger(t,e,i)},SetOption:function(t,e,i){if(this.m_listHandler.IsOptionUpdateAllowed(t,e,i)){var n=null;if("selection"===t){var s=i._context,a=s&&s.extraData&&s.extraData.items;a&&(s.extraData.item=this.ojContext._IsCustomElement()?0===a.length?null:a[0]:a,s.extraData.items=void 0),e&&e.length>0&&(n=e[0]),this._fireDeselectEvent(s.originalEvent,a,e)}else n=e;this.ojContext.option(t,n,i),this.options[t]=e,this.m_listHandler.OptionUpdated(t,n,i)}},ShouldRefresh:function(t){return null!=t.data||null!=t.drillMode||null!=t.item||null!=t.display||null!=t.edge},setOptions:function(t,e){var i,n={skipOptions:[]};return this.m_listHandler.SetOptions(t),void 0!==t.navigationLevel&&this._setNavigationLevel(t.navigationLevel),void 0!==t.selection&&(i=t.selection),n.needRefresh=s.superclass.setOptions.call(this,t,e),void 0!==i&&void 0===t.selection&&n.skipOptions.push("selection"),void 0!==i&&(t.selection=i),n},compareValues:function(e,i){return e==i||t.Object.compareValues(e,i)},HandleSelectionOption:function(t){var i;if(void 0!==t.selection)if(i=t.selection){var n=this.GetOption("selection");if(n&&0!==n.length&&this.compareValues(n[0],i))delete t.selection;else{var a=this.FindElementByKey(i);if(!a||this.IsSelectable(a))this._fireBeforeSelectEvent(null,e(a),i)?(this._fireDeselectEvent(null,a,i),t.selection=[i],a&&this._initiateNavigation(e(a))):delete t.selection;else delete t.selection}}else t.selection=[];s.superclass.HandleSelectionOption.call(this,t)},GetOption:function(t){var e=this.ojContext.option(t);return"selection"===t?e?[e]:[]:("item"!==t||e.focusable||(e.focusable=this._focusable),null===e?this.options[t]:e)},getWidgetConstructor:function(){return t.Components.__GetWidgetConstructor(this.ojContext.element)},SelectAndFocus:function(t,e){t.hasClass("oj-disabled")||this.IsSelectable(t[0])&&(!this._isSelected(t)&&this._fireBeforeSelectEvent(e,t)?(s.superclass.SelectAndFocus.apply(this,arguments),this._initiateNavigation(t)):this.HandleClickActive(t,e))},isTabBar:function(){return this.ojContext.element[0].tagName.toLowerCase()===this.TAG_NAME_TAB_BAR},_fireBeforeDeselectEvent:function(t,e,i){i||(i=this.GetKey(e[0]));var n=this.GetOption("selection"),s=this.FindElementByKey(n);return this.Trigger("beforeDeselect",t,{toItem:e,toKey:i,fromItem:s,fromKey:n})},_fireBeforeSelectEvent:function(t,e,i){var n=!0;return i||(i=this.GetKey(e[0])),this.isTabBar()&&(n=this._fireBeforeDeselectEvent(t,e,i)),n&&this.Trigger("beforeSelect",t,{item:e,key:i})},_fireRemoveEvent:function(t,e){var i=this.GetKey(e[0]);return this.Trigger("beforeRemove",t,{item:e,key:i})&&this.Trigger("remove",t,{item:e,key:i})},_fireDeselectEvent:function(t,e,i){var n=this.GetOption("selection"),s=this.FindElementByKey(n);this.Trigger("deselect",t,{toItem:e,toKey:i,fromItem:s,fromKey:n})},_initiateNavigation:function(t){if(this.ojContext.element.hasClass(this.getNoFollowLinkStyleClass()))return!1;var e=this.getItemContentElement(t),i=e.attr("href"),n=e.attr("target");return!(!i||"#"===i)&&(n&&"_self"!==n?window.open(i,n):window.location.href=i,!0)},_isSelected:function(t){var e,i;return e=this.GetOption("selection"),i=this.GetKey(t[0]),!(!e||1!==e.length||!this.compareValues(e[0],i))},_setToolTipOnIcon:function(t,e){t.attr("title")||t.attr("title",e)},_removeToolTipOnIcon:function(t){t.data(this._NAVLIST_ITEM_ICON_HAS_TITLE)?t.removeData(this._NAVLIST_ITEM_ICON_HAS_TITLE):t.removeAttr("title")},getSingleFocusableElement:function(t){var i,n,s=this;return i="a, input, select, textarea, button",1===(n=t.children(i).filter(function(t){return!e(this).hasClass(s.getNavListRemoveIcon())})).length&&0===n.first().find(i).length?n.first():t},PrepareContextMenu:function(t){null!=this.m_dndContext&&this.m_dndContext.prepareContextMenu(this.ojContext._GetContextMenu());var i=this.ojContext._GetContextMenu();if(t.hasClass(this.getRemovableStyleClass())&&i){this.m_contextMenu!=i&&(this.m_contextMenu=i,i.addEventListener("ojBeforeOpen",this._handleContextMenuBeforeOpen.bind(this)),i.addEventListener("ojAction",this._handleContextMenuSelect.bind(this)));var n=e(i).find("[data-oj-command="+this.getNavListRemoveCommand()+"]"),s=this.ojContext.getTranslatedString("labelRemove");this.ojContext._IsCustomElement()?n.empty().append(document.createTextNode(s)):n.empty().append(e('').text(s)),i.refresh()}},_handleContextMenuSelect:function(t,i){e(t.target).attr("data-oj-command")===this.getNavListRemoveCommand()&&this._handleRemove(t,this.m_contextMenuItem)},_handleContextMenuBeforeOpen:function(t){this.m_contextMenuItem=t.detail.openOptions.launcher},_handleRemove:function(t,e){e.hasClass(this.getRemovableStyleClass())&&this._fireRemoveEvent(t,e)},_wrapInner:function(t,e){for(var i=t.childNodes;i.length>0;)e.appendChild(i[0]);t.appendChild(e)},itemRenderComplete:function(t,i){var n=e(t);if(n.hasClass(this.getCategoryDividerStyleClass()))return n.removeClass(this.getItemElementStyleClass()),n.removeClass(this.getFocusedElementStyleClass()),n.removeClass(this.getItemStyleClass()),n.removeAttr("aria-selected"),n.children().remove(),void n.attr("role","separator");var a,o=this.getGroupItemStyleClass(),l=this.getCollapseIconStyleClass(),r=this.getExpandIconStyleClass(),d=this.getItemIconStyleClass(),h=n.children("."+o);if(h.length>0){h.addClass(this.getItemStyleClass()),a=h.children(":not(."+r+"):not(."+l+")");var _=h.children("."+r);0===_.length&&(_=h.children("."+l)),_.attr("role","presentation"),_.removeAttr("aria-labelledby"),n.hasClass("oj-disabled")&&h.addClass("oj-disabled")}else a=n.children().first();if(a.length>0){a.addClass(this.getItemContentStyleClass());var u=a.find("."+d),m=document.createElement("span");if(m.classList.add(this.getItemLabelStyleClass()),this._wrapInner(a[0],m),u.length>0){if(u.insertBefore(m),u.attr("title")&&u.data(this._NAVLIST_ITEM_ICON_HAS_TITLE,u.attr("title")),"icons"===this.ojContext.options.display){this.ojContext.element.addClass(this.getIconOnlyStyleClass());var c=this.getItemLabel(n);u.attr("aria-label",c),u.attr("role","img"),this._setToolTipOnIcon(u,c)}n.closest("ul").addClass(this.getHasIconsStyleClass())}else a.addClass(this.getHasNoIconStyleClass())}if(n.hasClass("oj-disabled")?this.getFocusItem(n).attr("aria-disabled","true"):h.length>0?h.addClass("oj-default"):n.addClass("oj-default"),n.hasClass(this.getRemovableStyleClass())&&this.isTabBar()){var v=e("");v.addClass(this.getNavListRemoveIcon()).addClass("oj-clickable-icon-nocontext oj-component-icon").attr("aria-label",this.ojContext.getTranslatedString("removeCueText")).attr("role","presentation").attr("aria-hidden","true"),n.append(v),a.attr("aria-describedby",v.uniqueId().attr("id"))}this.m_listHandler.ModifyListItem(n,a),s.superclass.itemRenderComplete.apply(this,arguments)},DestroyContentHandler:function(){null===this.GetOption("data")&&this._restoreContent(this.element),s.superclass.DestroyContentHandler.apply(this,arguments)},getNodeBySubId:function(t){var e,i=null;return null==t?this.ojContext.element?this.ojContext.element[0]:null:((i=this.m_listHandler.GetNodeBySubId(t))||t.subId===this.getItemSubIdKey()&&(e=t.key,i=this.FindElementByKey(e)),i)},getSubIdByNode:function(t){var e,i,n=null;return null!=t&&((n=this.m_listHandler.GetSubIdByNode(t))||null!=(e=this.FindItem(t))&&e.length>0&&null!=(i=this.GetKey(e[0]))&&(n={subId:this.getItemSubIdKey(),key:i})),n},getContextByNode:function(t){var e=s.superclass.getContextByNode.call(this,t);return e&&"oj-listview-item"==e.subId?(e.subId=this.getItemSubIdKey(),e):null},refresh:function(){this._resetNavlist(),this._initListHandler(),s.superclass.refresh.apply(this,arguments)},_resetNavlist:function(){this.ojContext.element.removeClass(this.getIconOnlyStyleClass()),this.ojContext.element.removeClass(this._APPLICATION_LEVEL_NAV_STYLE_CLASS),this.ojContext.element.removeClass(this._PAGE_LEVEL_NAV_STYLE_CLASS),this._restoreContent(this.element),this.m_listHandler.Destroy()},destroy:function(){this._resetNavlist(),s.superclass.destroy.apply(this,arguments),this._list.unwrap(),this._list.is(":empty")&&this._list.remove(),this.ojContext.element.removeClass(this.getNavListStyleClass()+" "+this.getNavListTouchStyleClass()),this.ojContext._off(this.element,"click"),this.ojContext._off(this.element,"focus"),this.ojContext._off(this.element,"blur"),this.ojContext._off(this.element,"mouseover"),this.ojContext._off(this.element,"mousein"),this.ojContext._off(this.element,"mouseout"),this.ojContext._off(this.element,"keydown")}});t.__registerWidget("oj.ojNavigationList",e.oj.baseComponent,{widgetEventPrefix:"oj",options:{currentItem:null,drillMode:"none",reorderable:"disabled",truncation:"none",edge:"start",hierarchyMenuDisplayThresholdLevel:0,rootLabel:null,selection:null,expanded:new t._ojListViewExpandedKeySet,data:null,display:"all",navigationLevel:"page",overflow:"hidden",item:{renderer:null,selectable:!0},animateStart:null,animateEnd:null,beforeSelect:null,beforeCollapse:null,beforeCurrentItem:null,beforeDeselect:null,collapse:null,deselect:null,beforeExpand:null,expand:null,reorder:null},_ComponentCreate:function(){this._super(),this._setup()},_AfterCreate:function(){this._super();var t=this;this.navlist._FixRendererContext=function(e){return t._FixRendererContext(e)},this.navlist._WrapCustomElementRenderer=function(e){return t._WrapCustomElementRenderer(e)},this.navlist.afterCreate()},_NotifyContextMenuGesture:function(t,e,i){this.navlist.notifyContextMenuGesture(t,e,i)},_setup:function(){var t,i;for(t in this.navlist=new s,this.options)this._validateOptionValues(t,this.options[t]);this._validateOptionsForIconsOnlyAndHorizontalList(this.options[this.navlist.OPTION_DRILL_MODE],this.options[this.navlist.OPTION_DISPLAY],this.options[this.navlist.OPTION_EDGE]),(i={}).ojContext=this,i=e.extend(this.options,i),this.navlist.init(i)},getNodeBySubId:function(t){return this.navlist.getNodeBySubId(t)},getSubIdByNode:function(t){return this.navlist.getSubIdByNode(t)},getContextByNode:function(t){return this.navlist.getContextByNode(t)},expand:function(t,e,i){this.navlist.expandKey(t,e,!0,!0,i)},collapse:function(t,e,i){this.navlist.collapseKey(t,e,!0,i)},getExpanded:function(){return this.navlist.getExpanded()},_validateOptionsForIconsOnlyAndHorizontalList:function(t,e,i){if(t!==this.navlist.OPTION_DRILL_MODE_NONE){if(e===this.navlist.OPTION_DISPLAY_ICONS)throw"Icon only navigation list should have drillMode set to 'none'.";if(i===this.navlist.OPTION_EDGE_TOP)throw"Horizontal navigation list should have drillMode set to 'none'."}},_validateOptionValues:function(t,e){var i=!0;if(t===this.navlist.OPTION_DRILL_MODE?i=e===this.navlist.OPTION_DRILL_MODE_NONE||e===this.navlist.OPTION_DRILL_MODE_COLLAPSIBLE||e===this.navlist.OPTION_DRILL_MODE_SLIDING:t===this.navlist.OPTION_DISPLAY?i=e===this.navlist.OPTION_DISPLAY_ALL||e===this.navlist.OPTION_DISPLAY_ICONS:t===this.navlist.OPTION_EDGE&&(i=this.element[0].tagName.toLowerCase()===this.navlist.TAG_NAME_TAB_BAR?e===this.navlist.OPTION_EDGE_TOP||e===this.navlist.OPTION_EDGE_START||e===this.navlist.OPTION_EDGE_END||e===this.navlist.OPTION_EDGE_BOTTOM:e===this.navlist.OPTION_EDGE_TOP||e===this.navlist.OPTION_EDGE_START),!i)throw"Invalid value: "+e+" for key: "+t},_setOption:function(t,i){var n,s;switch(this._validateOptionValues(t,i),t){case this.navlist.OPTION_DRILL_MODE:this._validateOptionsForIconsOnlyAndHorizontalList(i,this.options[this.navlist.OPTION_DISPLAY],this.options[this.navlist.OPTION_EDGE]);break;case this.navlist.OPTION_DISPLAY:this._validateOptionsForIconsOnlyAndHorizontalList(this.options[this.navlist.OPTION_DRILL_MODE],i,this.options[this.navlist.OPTION_EDGE]);break;case this.navlist.OPTION_EDGE:this._validateOptionsForIconsOnlyAndHorizontalList(this.options[this.navlist.OPTION_DRILL_MODE],this.options[this.navlist.OPTION_DISPLAY],i);break;case this.navlist.OPTION_SELECTION:case this.navlist.OPTION_CURRENT_ITEM:s=this.navlist.getItems([i])[0],n={_context:{extraData:{item:this._IsCustomElement()?s:e(s)}}}}return n?this._super(t,i,n):this._super(t,i)},_setOptions:function(t,e){var i,n=this.navlist.setOptions(t,e),s={};for(i in t)n.skipOptions.indexOf(i)<0&&(s[i]=t[i]);return this._super(s,e),n.needRefresh&&this.navlist.refresh(),this},_NotifyAttached:function(){this.navlist.notifyAttached()},_NotifyDetached:function(){this.navlist.notifyDetached()},_NotifyShown:function(){this.navlist.notifyShown()},_VerifyConnectedForSetup:function(){return!0},refresh:function(){this._super(),this.navlist.refresh()},whenReady:function(){return this.navlist.whenReady()},_SetupResources:function(){this._super(),this.navlist.setupResources()},_ReleaseResources:function(){this._super(),this.navlist.releaseResources()},_destroy:function(){this.navlist.destroy(),this._super()},_CompareOptionValues:function(e,i,n){switch(e){case"currentItem":case"selection":return t.Object.compareValues(i,n);default:return this._super(e,i,n)}}}),t.Components.setDefaultOptions({ojNavigationList:{hierarchyMenuDisplayThresholdLevel:t.Components.createDynamicPropertyGetter(function(){return(t.ThemeUtils.parseJSONFromFontFamily("oj-navigationlist-option-defaults")||{}).hierarchyMenuDisplayThresholdLevel})}}),i.extension._WIDGET_NAME="ojNavigationList",i.extension._ALIASED_PROPS={hierarchyMenuThreshold:"hierarchyMenuDisplayThresholdLevel"},t.CustomElementBridge.registerMetadata("oj-navigation-list","baseComponent",i),t.CustomElementBridge.register("oj-navigation-list",{metadata:t.CustomElementBridge.getMetadata("oj-navigation-list")}),n.extension._WIDGET_NAME="ojNavigationList",t.CustomElementBridge.registerMetadata("oj-tab-bar","baseComponent",n),t.CustomElementBridge.register("oj-tab-bar",{metadata:t.CustomElementBridge.getMetadata("oj-tab-bar")})});